package com.itheima;

import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int[] arr = new int[5];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输出第" + (i+1) + "个整数");
            int num = sc.nextInt();
            if (num >= 50 && num <= 100) {
                arr[i] = num;
            } else {
                System.out.println("本次输入数据范围有误,必须在[50,100]");
                i--;
            }
        }
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        System.out.println(sum);
    }
}